#include "variables.h"
#include "variables_def.h"
#include "functions.h"

int main( int argc, char *argv[] ){

  set_parameters( argc, argv );

  initialize_individuals();

  population_sort();

  initialize_elite();
  initialize_center_sigma();

  offspring();

  while( 1 ){
    number_of_generations++;

    population_sort();

    // 終了判定
    if( terminate() )
      break;

    elite_save();

    if( number_of_generations == 1 || number_of_generations % 100 == 0 )
      print_best();

    create_p_model();
    offspring();
    
  } // end of while


  destory_center_sigma();

  return 0;
}

